I quickly put this together. It gets the source quality video from tikwm or, alternatively, downloads the best available tiktok re-encode.
It is much slower because tikwm must download the video first before providing the play url from its cdn.

If tiktok patches it or tikwm changes his api, stop using this. I doubt it will last more than a few days.
Also to prevent unnecessary requests, use skip_existing and the parallel downloads option isn't recommended.

Other changes:
- Removed the 24h check for better encodes, since we can get source.
- All tiktok re-encodes are labeled "~sd" even if 1080p hevc. Only source encodes don't have the sd suffix.
- the tikwm api doesn't return the file hash, thus the integrity of source quality videos is always verified with ffprobe